Conventional disk drives with magnetic media organize data in concentric tracks that are spaced apart. The concept of shingled writing is a form of perpendicular magnetic recording and has been described as a way of increasing the areal density of magnetic recording. In shingle-written magnetic recording (SMR) media a region (band) of adjacent tracks are written so as to overlap one or more previously written tracks. The shingled tracks must be written in sequence unlike conventionally separated tracks, which can be written in any order. The tracks on a disk surface are organized into a plurality of shingled regions (also called I-regions). The direction of the shingled writing for a I-region can be from an inner diameter (ID) to an outer diameter (OD) or from OD to ID. The disk may also be shingled in both directions on the same surface, with the two zones meeting approximately at the mid-diameter point. The number of tracks shingled together in a region is a key performance parameter of shingled-writing. Once written in shingled structure, an individual track cannot be updated in place, because that would overwrite and destroy the data in the overlapping tracks. Shingle-written data tracks, therefore, from the user's viewpoint are sometimes thought of like append-only logs. To improve the performance of SMR drives, a portion of the magnetic media is allocated to one or more so-called “exception regions” (E-regions) which are used as staging areas for data which will ultimately be written to an I-region. The E-region is sometimes referred to as an E-cache. Since most of the data in an SMR drive is expected to be stored sequentially in I-regions, the data records that are not currently stored in the I-regions can be thought of as “exceptions” to sequential I-region storage. When randomly ordered writes are received, they are generally stored in the disk E-region in the order received.
U.S. Pat. No. 7,965,465 to Sanvido, et al. (Jun. 21, 2011) describes techniques for using cache memory to facilitate updating the records in shingled blocks of SMR disk storage which must be sequentially written.
Address indirection in the shingle-written storage device's internal architecture is useful to shield the host from the complexities associated with SMR. Conventionally host file systems use logical block addresses (LBAs) in commands to read and write blocks of data without regard for actual locations (physical block address (PBA)) used internally by the storage device. Hard disk drives have had some level of LBA-PBA indirection for decades that, among other things, allows bad sectors on the disk to be remapped to good sectors that have been reserved for this purpose. Address indirection is typically implemented in the controller portion of the drive's architecture. The controller translates the LBAs in host commands to an internal physical address, or an intermediate address from which a physical address can ultimately be derived.
The conventional LBA-PBA mapping for defects does not need to be changed often. In contrast, in an SMR device the physical block address (PBA) of a logical block address (LBA) can change frequently. The indirection system provides a dynamic translation layer between host LBAs and the current physical locations on the media. In an SMR system, the LBA-PBA mapping can change with every write operation because the system dynamically determines the physical location on the media where the host data for an LBA will be written. The data for the same LBA will be written to a different location the next time the host LBA is updated. In addition, the drive autonomously moves data between write caches in RAM, write caches on disk, E-regions on disk and I-regions on disk. The LBAs for the data stay the same regardless of where the drive has the data stored. Background processes such as defragmentation are also executed autonomously by the device to move data sectors from one PBA to another while the LBA stays the same.
Defragmentation is a general term often used to describe a process of reorganizing records in a file or database system to eliminate or reduce the fragmentation. In SMR I-regions when records are updated or deleted the number of small free spaces, which are usually referred to as invalidated or ‘stale’ data, increases. The process of defragmentation physically moves the records to make them more contiguous as well as create larger, more useful free regions. DRAM is typically used in restaging because it allows efficient sorting of records into proper sequence. In SMR drives efficient defragmentation is an important factor in the overall performance of the device.